<?php
	require_once("../includes/database.php");
	$db=new Database;
	$date= date('Y-m-d');
	$res=$db->selectAll('hits',"date = '$date'",'','*');
	$no=mysql_num_rows($res);
	if($no==1)
	{
		$row=mysql_fetch_array($res);
		$hits=$row['hits']+1;
		$db->record['hits']=$hits;
		$db->update('hits',"date = '$date'");
	}
	else
	{
		$db->record['date']=$date;
		$db->record['hits']=1;
		$db->save('hits');
	}
 ?>